CREATE TABLE [dbo].[TDCAJA_DIST]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CAJA] [dbo].[TD_VC_008] NOT NULL,
[AA_CAJA] [dbo].[TD_VC_004] NOT NULL,
[MM_CAJA] [dbo].[TD_VC_002] NOT NULL,
[TI_MOVI] [dbo].[TD_VC_001] NOT NULL,
[NU_COMP_CAJA] [dbo].[TD_VC_008] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDCAJA_DI__NU_SE__24B26D99] DEFAULT ((0)),
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NULL,
[TI_MOVI_OPER] [dbo].[TD_VC_001] NULL,
[CO_TIPO_AUXI] [dbo].[TD_VC_001] NULL,
[CO_AUXI_EMPR] [dbo].[TD_VC_020] NULL,
[CO_ORDE_SERV] [dbo].[TD_VC_020] NULL,
[ST_DIST] [dbo].[TD_VC_001] NOT NULL,
[PO_DIST] [dbo].[TD_NU_009_004] NULL CONSTRAINT [DF__TDCAJA_DI__PO_DI__25A691D2] DEFAULT ((0)),
[IM_DIST] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCAJA_DI__IM_DI__269AB60B] DEFAULT ((0)),
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[FE_DOCU] [dbo].[TD_DT_001] NULL,
[NU_DOCU] [dbo].[TD_VC_020] NULL,
[TI_DOCU] [dbo].[TD_VC_003] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCAJA_DI__CO_US__278EDA44] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCAJA_DI__FE_US__2882FE7D] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCAJA_DI__CO_US__297722B6] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCAJA_DI__FE_US__2A6B46EF] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCAJA_DIST] ADD CONSTRAINT [PK__TDCAJA_D__728CABD301B41576] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCAJA_DIST] ADD CONSTRAINT [FK__TDCAJA_DIST__2E71AD54] FOREIGN KEY ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA]) REFERENCES [dbo].[TCMOVI_CAJA] ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA])
GO
